package com.ms.oschina.viewholder;

import android.graphics.Color;
import android.util.TypedValue;
import android.view.View;
import android.widget.TextView;

import com.ms.oschina.R;
import com.ms.oschina.base.BaseViewHolder;
import com.ms.oschina.bean.Favorite;
import com.ms.oschina.util.UiUtils;

public class FavoriteViewHolder extends BaseViewHolder<Favorite> {
	private TextView tv;

	@Override
	public View initView() {
		tv = new TextView(UiUtils.getContext());
		int size = UiUtils.getDimensionPixelSize(R.dimen.space_14);
		tv.setTextSize(TypedValue.COMPLEX_UNIT_PX,size);
		tv.setTextColor(Color.BLACK);
		tv.setLines(1);
		int padding = UiUtils.getDimensionPixelSize(R.dimen.space_8);
		tv.setPadding(padding, padding, padding, padding);
		return tv;
	}

	@Override
	public void setData(int position, Favorite data) {
		tv.setText(data.getTitle());
	}

}
